import dayjs from 'dayjs'

export function fTime(app)
{
    app.directive("fTime", {
        mounted(el,bindings) {
            let format = bindings.value;
            let value = el.textContent;
            if (value.length === 10) value *= 1000;
            if (!format)
            {
                format = "YYYY/MM/DD-hh:mm:ss";    
            }
            el.textContent = dayjs(value).format(format);
        },
    })
}